home *** CD-ROM | disk | FTP | other *** search
Oberon Document | 1996-01-05 | 2.7 KB | 79 lines | [oODC/obnF] |
- Documents.StdDocumentDesc
- Documents.DocumentDesc
- Containers.ViewDesc
- Views.ViewDesc
- Stores.StoreDesc
- Documents.ModelDesc
- Containers.ModelDesc
- Models.ModelDesc
- Stores.ElemDesc
- TextViews.StdViewDesc
- TextViews.ViewDesc
- TextModels.StdModelDesc
- TextModels.ModelDesc
- TextModels.AttributesDesc
- Helvetica
- Helvetica
- Helvetica
- MODULE ObxPatterns;
- IMPORT Ports, Stores, Views, Properties;
- CONST minVersion = 0; maxVersion = 0;
- TYPE View = POINTER TO RECORD (Views.ViewDesc) END;
- PROCEDURE (v: View) Internalize (VAR rd: Stores.Reader);
- VAR thisVersion: SHORTINT;
- BEGIN
- v.Internalize^(rd);
- IF ~rd.cancelled THEN
- rd.ReadVersion(minVersion, maxVersion, thisVersion)
- END
- END Internalize;
- PROCEDURE (v: View) Externalize (VAR wr: Stores.Writer);
- BEGIN
- v.Externalize^(wr);
- wr.WriteVersion(maxVersion)
- END Externalize;
- PROCEDURE (v: View) Restore (f: Views.Frame; l, t, r, b: LONGINT);
- VAR w, h, d: LONGINT; col: INTEGER; colors: ARRAY 3 OF Ports.Color;
- BEGIN
- colors[0] := Ports.red; colors[1] := Ports.green; colors[2] := Ports.blue;
- v.context.GetSize(w, h);
- d := 4 * f.dot; col := 0;
- l := 0; t := 0; r := w; b := h;
- WHILE (r> l) & (b > t) DO
- f.DrawRect(l, t, r, b, f.dot, colors[col]);
- INC(l, d); INC(t, d); DEC(r, d); DEC(b, d); col := (col + 1) MOD 3
- END
- END Restore;
- PROCEDURE (v: View) HandlePropMsg (VAR p: Properties.Message);
- CONST min = 10 * Ports.mm; max = 160 * Ports.mm; pref = 90 * Ports.mm;
- BEGIN
- WITH p: Properties.SizePref DO (* prevent illegal sizes *)
- IF p.w = Views.undefined THEN (* no preference for width -> skip *)
- ELSIF p.w < min THEN p.w := min
- ELSIF p.w > max THEN p.w := max
- END;
- IF p.h = Views.undefined THEN p.h := pref
- ELSIF p.h < min THEN p.h := min
- ELSIF p.h > max THEN p.h := max
- END
- ELSE
- END
- END HandlePropMsg;
- PROCEDURE Deposit*;
- VAR v: View;
- BEGIN
- NEW(v); Views.Deposit(v)
- END Deposit;
- END ObxPatterns.
- TextControllers.StdCtrlDesc
- TextControllers.ControllerDesc
- Containers.ControllerDesc
- Controllers.ControllerDesc
- TextRulers.StdRulerDesc
- TextRulers.RulerDesc
- TextRulers.StdStyleDesc
- TextRulers.StyleDesc
- TextRulers.AttributesDesc
- Helvetica
- Documents.ControllerDesc
-